using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace WindowsPhoneGame1.Shapes
{
    public class PointF : Shape
    {
        public float X { get; set; }
        public float Y { get; set; }
        public override RectangleF Bounds { get; protected set; }

        public PointF(float x, float y) : base()
        {
            X = x;
            Y = y;
            SetBounds();
        }

        public override void SetBounds()
        {
            Bounds = new RectangleF(X, Y, 0, 0);
        }

        public ContainmentType Contains(PointF other)
        {
            if (Math.Abs(other.X - X) < MARGIN &&
                Math.Abs(other.Y - Y) < MARGIN)
                return ContainmentType.Intersects;
            return ContainmentType.Disjoint;
        }

        public override ContainmentType contains(Shape shape)
        {
            if (shape is PointF)
                return Contains((PointF)shape);
            throw new ArgumentException("Does not support collision with type " + shape.GetType());
        }
    }
}
